home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / internet / net commander 1.0 / ISP / SCRPTLST / FLEX.CMD < prev    next >
Encoding:
Text File  |  1996-02-12  |  3.6 KB  |  174 lines

  1. # FLEX login.cmd for use with Trumpet Winsock 2.0b 
  2. # speed-dialler and "Flex" customization by John Shalamskas
  3. #
  4. #trace on
  5.  
  6. #
  7. # Here are the variables for you to fiddle with.
  8. #
  9. %redials = 50
  10. #       Generic Modem Setup (use if ATZ is enough for you.)
  11. $modemsetup = "S11=50"
  12. #
  13. #       Other simple things to try if that didn't work:
  14. #$modemsetup = "&FS11=50M1X7"
  15. #$modemsetup = "&FS11=50"
  16. #$modemsetup = "&F"
  17. #$modemsetup = "Z"
  18. #
  19. #    Microcom Deskporte FAST ES 28.8 (and generic Rockwell chipsets)
  20. #$modemsetup = "&f&c1&D2&s1w1s11=50"
  21. #
  22. #    USR Sportster V.34 talking to another V.34 modem (PIXI, Lavanet): 
  23. #$modemsetup = "&F1 S11=50"
  24. #    USR Sportster V.34: use following to disable v.34, V.42
  25. #$modemsetup = "&F1 S11=50 S56=64 S27=32"
  26. #    USR Sportster V.34: force 24000 bps, disable v.34, disable v.42 (FLEX)
  27. #$modemsetup = "&F1 S11=50 &N12 S56=64 S27=32"
  28. #    USR Sportster V.34: disable v.FC, disable v.42 (FLEX)
  29. #$modemsetup = "&F1 S11=50 S56=128 S27=32"
  30. #
  31. #          ZyXEL U-1496E
  32. #$modemsetup = "&FM1X7S11=50"
  33. #
  34. $prompt = ""
  35. $userprompt = "ogin:"
  36. $passprompt = "word:"
  37. $slipcmd = ""
  38. $pppcmd = ""
  39. $addrtarg = "to "
  40. #
  41. # END of variables - STOP FIDDLING here 
  42. # unless you know what you are doing!
  43. #
  44.  
  45. #
  46. # set up some strings for dialling up
  47. #
  48. if ![load $number]
  49.   if [query $number "Enter your dial up phone number"]
  50.     save $number
  51.   end
  52. end
  53. if ![load $username]
  54.   if [username "Enter your shell login username"]
  55.     save $username
  56.   end
  57. end
  58. if ![load $password]
  59.   if [password "Enter your shell login password"]
  60.     save $password
  61.   end
  62. end
  63.  
  64. #---------------------- Initialization ---------------------------
  65. #
  66. %counter = %redials
  67. #
  68. # Initialize Modem
  69. #
  70. set dtr on
  71. output atz\r
  72. display \n 
  73. if ! [input 3 OK\n]
  74.   display "Modem is not responding"\n
  75.   abort
  76. end
  77. #
  78. # setup our modem commands
  79. #
  80. output "at"$modemsetup\13
  81. input 5 OK\n
  82. #
  83. #----------------- BEGIN AUTODIAL LOOP ------------------
  84. #
  85. #trace on
  86. repeat
  87.   %counter = %counter - 1
  88.   %tries = %redials - %counter
  89.   display Attempt number %tries ( %redials possible )\n
  90.   if ! %counter <> 0
  91.     display \n
  92.     display Aborting after %tries redials.\n 
  93.     abort
  94.   end
  95.   #
  96.   # Dial Aloha.Com
  97.   #
  98.   # The following "sleep" command only needed for 
  99.   # USR Sportster and maybe a few others.
  100.   #
  101.   sleep 1
  102.   output "atdt"$number\13
  103.   %busy = [input 15 BUSY\n]
  104. until ! %busy
  105. #
  106. #---------------- END AUTODIAL LOOP ---------------------
  107. #
  108. # At this point we have no busy signal.  Go for connect.
  109. #
  110. %connect = [input 30 CONNECT]
  111. if %connect=0
  112.   set dtr off
  113.   sleep 1
  114.   set dtr on
  115.   output +++
  116.   sleep 1
  117.   display \n
  118.   output ath0\r
  119.   display \n
  120.   display Unknown error.  Try Dialler/Login. \n
  121.   abort
  122. end
  123. #
  124. #  wait till it's safe to send because some modems hang up
  125. #  if you transmit during the connection phase
  126. #
  127. wait 30 dcd
  128. #
  129. #  wait for the username prompt
  130. #
  131. input 30 $userprompt
  132. if %ppp
  133.    output "P"$username\13
  134. else
  135.    output "S"$username\13
  136. end
  137. #
  138. # and the password
  139. #
  140. input 30 $passprompt
  141. output $password\13
  142. #
  143. # we are now logged in
  144. #
  145. display \nConnected after %tries tries.\n
  146. if %ppp
  147.   #
  148.   # jump into ppp mode
  149.   #
  150.   #output $pppcmd\13
  151.   #
  152.   #input 30 \n
  153.   #
  154.   display "PPP mode selected.  Will try to negotiate IP address."\n
  155.   #
  156. else
  157.   #
  158.   # jump into slip mode
  159.   #
  160.   #output $slipcmd\13
  161.   #
  162.   # wait for the address string
  163.   #
  164.   input 30 $addrtarg
  165.   #
  166.   # parse address
  167.   #
  168.   address 30
  169.   #
  170.   # we are now connected, logged in and in slip mode.
  171.   #
  172.   display \nDuring this session your IP address is \i.\n\n\n
  173. end
  174.